home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Fonts.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
13KB
|
422 lines
{
File: Fonts.p
Contains: Font Manager Interfaces.
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Fonts;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __FONTS__}
{$SETC __FONTS__ := 1}
{$I+}
{$SETC FontsIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __GXTYPES__}
{$I GXTypes.p}
{$ENDC}
{$IFC UNDEFINED __QUICKDRAW__}
{$I Quickdraw.p}
{$ENDC}
{$IFC UNDEFINED __TEXTCOMMON__}
{$I TextCommon.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
CONST
systemFont = 0;
applFont = 1;
newYork = 2;
geneva = 3;
monaco = 4;
venice = 5;
london = 6;
athens = 7;
sanFran = 8;
toronto = 9;
cairo = 11;
losAngeles = 12;
times = 20;
helvetica = 21;
courier = 22;
symbol = 23;
mobile = 24;
commandMark = 17;
checkMark = 18;
diamondMark = 19;
appleMark = 20;
propFont = 36864;
prpFntH = 36865;
prpFntW = 36866;
prpFntHW = 36867;
fixedFont = 45056;
fxdFntH = 45057;
fxdFntW = 45058;
fxdFntHW = 45059;
fontWid = 44208;
TYPE
FMInputPtr = ^FMInput;
FMInput = PACKED RECORD
family: INTEGER;
size: INTEGER;
face: Style;
needBits: BOOLEAN;
device: INTEGER;
numer: Point;
denom: Point;
END;
{
#pragma output c
typedef struct OpaquePrivateFontResult *privateFontResult;
#pragma output pascal
typedef Ptr privateFontResult;
#pragma output all
}
FontResult = ^LONGINT;
FMOutputPtr = ^FMOutput;
FMOutput = PACKED RECORD
errNum: INTEGER;
fontResult: FontResult;
boldPixels: UInt8;
italicPixels: UInt8;
ulOffset: UInt8;
ulShadow: UInt8;
ulThick: UInt8;
shadowPixels: UInt8;
extra: SInt8;
ascent: UInt8;
descent: UInt8;
widMax: UInt8;
leading: SInt8;
curStyle: SInt8;
numer: Point;
denom: Point;
END;
FMOutPtr = ^FMOutput;
FontRecPtr = ^FontRec;
FontRec = RECORD
fontType: INTEGER; { font type }
firstChar: INTEGER; { ASCII code of first character }
lastChar: INTEGER; { ASCII code of last character }
widMax: INTEGER; { maximum character width }
kernMax: INTEGER; { negative of maximum character kern }
nDescent: INTEGER; { negative of descent }
fRectWidth: INTEGER; { width of font rectangle }
fRectHeight: INTEGER; { height of font rectangle }
owTLoc: INTEGER; { offset to offset/width table }
ascent: INTEGER; { ascent }
descent: INTEGER; { descent }
leading: INTEGER; { leading }
rowWords: INTEGER; { row width of bit image / 2 }
END;
FMetricRecPtr = ^FMetricRec;
FMetricRec = RECORD
ascent: Fixed; { base line to top }
descent: Fixed; { base line to bottom }
leading: Fixed; { leading between lines }
widMax: Fixed; { maximum character width }
wTabHandle: Handle; { handle to font width table }
END;
{
typedef struct FMetricRec FMetricRec, *FMetricRecPtr;
typedef FMetricRecPtr *FMetricRecHandle;
}
FMetricRecHandle = ^FMetricRecPtr;
WidEntryPtr = ^WidEntry;
WidEntry = RECORD
widStyle: INTEGER; { style entry applies to }
END;
WidTablePtr = ^WidTable;
WidTable = RECORD
numWidths: INTEGER; { number of entries - 1 }
END;
AsscEntryPtr = ^AsscEntry;
AsscEntry = RECORD
fontSize: INTEGER;
fontStyle: INTEGER;
fontID: INTEGER; { font resource ID }
END;
FontAssocPtr = ^FontAssoc;
FontAssoc = RECORD
numAssoc: INTEGER; { number of entries - 1 }
END;
StyleTablePtr = ^StyleTable;
StyleTable = RECORD
fontClass: INTEGER;
offset: LONGINT;
reserved: LONGINT;
indexes: PACKED ARRAY [0..47] OF CHAR;
END;
NameTablePtr = ^NameTable;
NameTable = RECORD
stringCount: INTEGER;
baseFontName: Str255;
END;
KernPairPtr = ^KernPair;
KernPair = RECORD
kernFirst: SInt8; { 1st character of kerned pair }
kernSecond: SInt8; { 2nd character of kerned pair }
kernWidth: INTEGER; { kerning in 1pt fixed format }
END;
KernEntryPtr = ^KernEntry;
KernEntry = RECORD
kernStyle: INTEGER; { style the entry applies to }
kernLength: INTEGER; { length of this entry }
END;
KernTablePtr = ^KernTable;
KernTable = RECORD
numKerns: INTEGER; { number of kerning entries }
END;
WidthTablePtr = ^WidthTable;
WidthTable = PACKED RECORD
tabData: ARRAY [0..255] OF Fixed; { character widths }
fontResult: FontResult; { font record used to build table }
sExtra: LONGINT; { space extra used for table }
style: LONGINT; { extra due to style }
fID: INTEGER; { font family ID }
fSize: INTEGER; { font size request }
face: INTEGER; { style (face) request }
device: INTEGER; { device requested }
inNumer: Point; { scale factors requested }
inDenom: Point; { scale factors requested }
aFID: INTEGER; { actual font family ID for table }
fHand: Handle; { family record used to build up table }
usedFam: BOOLEAN; { used fixed point family widths }
aFace: UInt8; { actual face produced }
vOutput: INTEGER; { vertical scale output value }
hOutput: INTEGER; { horizontal scale output value }
vFactor: INTEGER; { vertical scale output value }
hFactor: INTEGER; { horizontal scale output value }
aSize: INTEGER; { actual size of actual font used }
tabSize: INTEGER; { total size of table }
END;
FamRecPtr = ^FamRec;
FamRec = RECORD
ffFlags: INTEGER; { flags for family }
ffFamID: INTEGER; { family ID number }
ffFirstChar: INTEGER; { ASCII code of 1st character }
ffLastChar: INTEGER; { ASCII code of last character }
ffAscent: INTEGER; { maximum ascent for 1pt font }
ffDescent: INTEGER; { maximum descent for 1pt font }
ffLeading: INTEGER; { maximum leading for 1pt font }
ffWidMax: INTEGER; { maximum widMax for 1pt font }
ffWTabOff: LONGINT; { offset to width table }
ffKernOff: LONGINT; { offset to kerning table }
ffStylOff: LONGINT; { offset to style mapping table }
ffProperty: ARRAY [0..8] OF INTEGER; { style property info }
ffIntl: ARRAY [0..1] OF INTEGER; { for international use }
ffVersion: INTEGER; { version number }
END;
FontPointSize = SInt16;
FontFamilyID = SInt16;
PROCEDURE InitFonts;
{$IFC NOT GENERATINGCFM}
INLINE $A8FE;
{$ENDC}
PROCEDURE GetFontName(familyID: INTEGER; VAR name: Str255);
{$IFC NOT GENERATINGCFM}
INLINE $A8FF;
{$ENDC}
PROCEDURE GetFNum(name: Str255; VAR familyID: INTEGER);
{$IFC NOT GENERATINGCFM}
INLINE $A900;
{$ENDC}
FUNCTION RealFont(fontNum: INTEGER; size: INTEGER): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $A902;
{$ENDC}
PROCEDURE SetFontLock(lockFlag: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $A903;
{$ENDC}
FUNCTION FMSwapFont({CONST}VAR inRec: FMInput): FMOutPtr;
{$IFC NOT GENERATINGCFM}
INLINE $A901;
{$ENDC}
PROCEDURE SetFScaleDisable(fscaleDisable: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $A834;
{$ENDC}
PROCEDURE FontMetrics(theMetrics: FMetricRecPtr);
{$IFC NOT GENERATINGCFM}
INLINE $A835;
{$ENDC}
PROCEDURE SetFractEnable(fractEnable: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $A814;
{$ENDC}
FUNCTION GetDefFontSize: INTEGER;
{$IFC NOT GENERATINGCFM}
INLINE $3EB8, $0BA8, $6604, $3EBC, $000C;
{$ENDC}
FUNCTION IsOutline(numer: Point; denom: Point): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $7000, $A854;
{$ENDC}
PROCEDURE SetOutlinePreferred(outlinePreferred: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $7001, $A854;
{$ENDC}
FUNCTION GetOutlinePreferred: BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $7009, $A854;
{$ENDC}
FUNCTION OutlineMetrics(byteCount: INTEGER; textPtr: UNIV Ptr; numer: Point; denom: Point; VAR yMax: INTEGER; VAR yMin: INTEGER; awArray: FixedPtr; lsbArray: FixedPtr; boundsArray: RectPtr): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $7008, $A854;
{$ENDC}
PROCEDURE SetPreserveGlyph(preserveGlyph: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $700A, $A854;
{$ENDC}
FUNCTION GetPreserveGlyph: BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $700B, $A854;
{$ENDC}
FUNCTION FlushFonts: OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $700C, $A854;
{$ENDC}
FUNCTION GetSysFont: INTEGER;
{$IFC NOT GENERATINGCFM}
INLINE $3EB8, $0BA6;
{$ENDC}
FUNCTION GetAppFont: INTEGER;
{$IFC NOT GENERATINGCFM}
INLINE $3EB8, $0984;
{$ENDC}
{$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
PROCEDURE AntiTextSetApplicationAware(aware: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $7024, $A854;
{$ENDC}
FUNCTION AntiTextGetApplicationAware: BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $7025, $A854;
{$ENDC}
PROCEDURE AntiTextSetEnabled(enabled: BOOLEAN);
{$IFC NOT GENERATINGCFM}
INLINE $7026, $A854;
{$ENDC}
FUNCTION AntiTextGetEnabled: BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $7027, $A854;
{$ENDC}
FUNCTION AntiTextIsAntiAliased(numer: Point; denom: Point): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $7028, $A854;
{$ENDC}
{$ENDC}
{$IFC FOR_SYSTEM8_COOPERATIVE }
CONST
kSystemSpecialFont = 1;
kApplicationSpecialFont = 2;
kSmallSystemSpecialFont = 3;
kEmphasisSpecialFont = 4;
kKeyboardSymbolSpecialFont = 5;
kCountSpecialFonts = 5;
TYPE
SpecialFontSelector = UInt32;
{ -------------------------------------------------------------- }
TextStrikeRef = ^LONGINT;
CONST
kDefaultTextStrike = 0;
kAntiAliasTextStrike = $0001;
kFractionalWidthsTextStrike = $0002;
kPreserveGlyphTextStrike = $0004;
kPreserveTextStrikeElement = $8000; { for QDSetStrikeElements }
TYPE
TextStrikeOption = OptionBits;
{ -------------------------------------------------------------- }
FUNCTION QDNewStrike: TextStrikeRef; C;
PROCEDURE QDDisposeStrike(strike: TextStrikeRef); C;
FUNCTION QDCloneStrike(strike: TextStrikeRef): TextStrikeRef; C;
FUNCTION QDCopyStrike(source: TextStrikeRef): TextStrikeRef; C;
PROCEDURE QDReplaceStrike(destination: TextStrikeRef; source: TextStrikeRef); C;
FUNCTION QDEqualStrike(strike1: TextStrikeRef; strike2: TextStrikeRef): BOOLEAN; C;
FUNCTION QDStrikeOwnerCount(strike: TextStrikeRef): ItemCount; C;
FUNCTION QDFlattenStrike(strike: TextStrikeRef; VAR stream: Byte): ByteCount; C;
FUNCTION QDUnflattenStrike(strike: TextStrikeRef; {CONST}VAR stream: Byte; VAR size: ByteCount): TextStrikeRef; C;
PROCEDURE QDGetStrikeElements(strike: TextStrikeRef; VAR familyID: INTEGER; VAR styleBits: INTEGER; VAR pointSize: INTEGER); C;
PROCEDURE QDSetStrikeElements(strike: TextStrikeRef; familyID: INTEGER; styleBits: INTEGER; pointSize: INTEGER); C;
FUNCTION QDGetStrikeOptions(strike: TextStrikeRef): TextStrikeOption; C;
PROCEDURE QDSetStrikeOptions(strike: TextStrikeRef; options: TextStrikeOption); C;
FUNCTION QDGetStrikeSpecialFont(strike: TextStrikeRef): SpecialFontSelector; C;
PROCEDURE QDSetStrikeSpecialFont(strike: TextStrikeRef; selector: SpecialFontSelector); C;
FUNCTION QDGetStrikeEncoding(strike: TextStrikeRef): TextEncoding; C;
PROCEDURE QDSetStrikeEncoding(strike: TextStrikeRef; encoding: TextEncoding); C;
FUNCTION QDGetStrikeFeatures(strike: TextStrikeRef; VAR features: gxRunFeature): ItemCount; C;
PROCEDURE QDSetStrikeFeatures(strike: TextStrikeRef; count: ItemCount; {CONST}VAR features: gxRunFeature); C;
FUNCTION QDGetStrikeVariations(strike: TextStrikeRef; VAR variations: gxFontVariation): ItemCount; C;
PROCEDURE QDSetStrikeVariations(strike: TextStrikeRef; count: ItemCount; {CONST}VAR variations: gxFontVariation); C;
FUNCTION QDGetStrikeMapping(strike: TextStrikeRef; VAR map: gxMapping): gxMappingPtr; C;
PROCEDURE QDSetStrikeMapping(strike: TextStrikeRef; {CONST}VAR map: gxMapping); C;
FUNCTION QDGetPortStrike(VAR port: CGrafPort): TextStrikeRef; C;
PROCEDURE QDSetPortStrike(VAR port: CGrafPort; strike: TextStrikeRef); C;
FUNCTION QDGetStrikeCustomItem(strike: TextStrikeRef; tag: OSType; dataP: BytePtr): ByteCount; C;
PROCEDURE QDSetStrikeCustomItem(strike: TextStrikeRef; tag: OSType; dataP: BytePtr; size: ByteCount); C;
PROCEDURE QDSetStrikeColors(strike: TextStrikeRef; VAR foreColor: RGBColor; VAR backColor: RGBColor); C;
PROCEDURE QDGetStrikeColors(strike: TextStrikeRef; VAR foreColor: RGBColor; VAR backColor: RGBColor); C;
PROCEDURE QDSetStrikeTransferMode(strike: TextStrikeRef; textMode: INTEGER); C;
FUNCTION QDGetStrikeTransferMode(strike: TextStrikeRef): INTEGER; C;
{ -------------------------------------------------------------- }
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := FontsIncludes}
{$ENDC} {__FONTS__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}